<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title><s:text name="page.title.prefix" /> <s:property value="#pageTitle" /></title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/style.css" />
		<script>
    	var propertyId = "<s:property value="property.id"/>";
    	function removeValueObjct(propertyValueId){
    		location.href="removePropertyValue.do?propertyValue.id="+propertyValueId+"&property.id="+propertyId;
    	}
    </script>
	</head>
	<body>

		<div>
			view
			<form action="saveProperty.do">
				<ul>
					<li>
						<input name="property.id" value="<s:property value="property.id"/>" type="hidden" class="input" />
					</li>
					<li>
						<input name="property.name" value="<s:property value="property.name"/>" type="text" class="input" />
					</li>
					<li>
						Whether can ordered:
						<input type="radio" name="property.canOrdered" value="true" <s:if test="property.canOrdered">checked</s:if> />
						Yes
						<input type="radio" name="property.canOrdered" value="false" <s:if test="!property.canOrdered">checked</s:if> />
						No
					</li>
				</ul>
				<input type="submit" value="submit">
			</form>

			<ul>
				<s:iterator value="property.getValues()">
					<li>
						<s:property value="value" />
						<a href="javascript:removeValueObjct('<s:property value="id"/>')">X</a>
					</li>
				</s:iterator>
			</ul>

			<form action="savePropertyValue.do">

				<input name="property.id" value="<s:property value="property.id"/>" type="hidden" class="input" />

				<li>
					<input name="propertyValue.id" value="<s:property value="propertyValue.id"/>" type="hidden" class="input" />
				</li>
				<li>
					<input name="propertyValue.value" value="<s:property value="propertyValue.value"/>" type="text" class="input" />
				</li>

				<input type="submit" value="submit">
			</form>

		</div>

		<jsp:include page="/include/alertErrors.jsp" />
	</body>

</html>